package lab02.test03;

/**
 * Created by V555 on 2017/10/12.
 */
public class Student {
    //属性：
    float computerScore;
    float mathScore;
    float englishScore;
    //行为
    float sum(){
        return computerScore+mathScore+englishScore;
    }
    float average(){
        return(computerScore+mathScore+englishScore)/3;
    }
    float maxScore(){
        if (computerScore>mathScore&&computerScore>englishScore)
            return computerScore;
        else if (mathScore>englishScore&&mathScore>computerScore)
            return mathScore;
        else return englishScore;
    }
    float minScore(){
        if (computerScore<mathScore&&computerScore<englishScore)
            return computerScore;
        else if (mathScore<computerScore&&mathScore<englishScore)
            return mathScore;
        else return englishScore;
    }
    void printStudent() {
        System.out.println("计算机成绩" + computerScore);
        System.out.println("数学成绩" + mathScore);
        System.out.println("英语成绩" + englishScore);
        System.out.println("总分" + sum());
        System.out.println("平均分" + average());
        System.out.println("最高分" + maxScore());
        System.out.println("最低分" + minScore());
    }
}